//
//  PriceView.m
//  News
//
//  Created by weige on 16/6/4.
//  Copyright © 2016年 weige. All rights reserved.
//

#import "PriceView.h"
@interface PriceView()
{
    UIView *line;
}
@end
@implementation PriceView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
    
        [self createViewUI];
        
    }
    return self;
}


-(void)createViewUI
{
    self.currentPrice=[[UILabel alloc]init];
    self.currentPrice.font=[UIFont systemFontOfSize:TitleFontSize];
    self.currentPrice.textColor=[UIColor redColor];
    [self addSubview:self.currentPrice];
    self.markprice=[[UILabel alloc]init];
    self.markprice.font=[UIFont systemFontOfSize:TitleFontSize];
    self.markprice.textColor=TITLECOLOR;
    [self addSubview:self.markprice];
    line=[[UIView alloc]init];
    line.backgroundColor=[UIColor lightGrayColor];
    [self addSubview: line];
}

-(void)layoutSubviews
{
    self.currentPrice.frame=CGRectMake(0, 0, (self.frame.size.width-20)/2, self.frame.size.height);
    
    self.markprice.frame=CGRectMake(CGRectGetMaxX(self.currentPrice.frame), 0, (self.frame.size.width-20)/2, self.frame.size.height);
    line.frame=CGRectMake(CGRectGetMaxX(self.currentPrice.frame), CGRectGetMaxY(self.markprice.frame)/2-0.5, (self.frame.size.width-20)/2, 1);

}
@end
